
import {
    ASDE_CHANGE_TABLE_LOADING,
    ASDE_SET_TABLE_DATA,
    ASDE_SET_PERSON,
    ASDE_CHANGE_SELECT_KEY,
    ASDE_CHANGE_PERSON_TYPE
} from './actions'

const initState = {
    tableData: [],
    loading: false,
    data: {
        zu: [],
        member: [],
        data: []
    },
    params: {
        time: [],
        phoneNo: '',
        name: '',
        orderNo: '',
        orderStatus: '0',
        person: ''
    },
    personData: [],
    selectKeys: [],
    personType: ''
};

const atosStatisticsState = (state = initState, action) => {
    switch (action.type) {
        case ASDE_SET_TABLE_DATA:
            return { ...state, data: action.data };
        case ASDE_CHANGE_TABLE_LOADING:
            return { ...state, loading: action.option };
        case ASDE_SET_PERSON:
            return { ...state, personData: action.data };
        case ASDE_CHANGE_SELECT_KEY:
            return { ...state, selectKeys: action.data };
        case ASDE_CHANGE_PERSON_TYPE:
            return { ...state, personType: action.option };
        default:
            return state;
    }
};
export default atosStatisticsState;